import { ApiProperty } from '@nestjs/swagger'
import { Column, Entity } from 'typeorm'

import { CompleteEntity } from '~/common/entity/common.entity'

@Entity({ name: 'system_dict_data' })
export class DictDataEntity extends CompleteEntity {
  @Column({ type: 'int', default: 0, comment: '字典排序' })
  @ApiProperty({ description: '字典排序' })
  sort: number

  @Column({ type: 'varchar', length: 100, comment: '字典标签' })
  @ApiProperty({ description: '字典标签' })
  label: string

  @Column({ type: 'varchar', length: 100, comment: '字典键值' })
  @ApiProperty({ description: '字典键值' })
  value: string

  @Column({ name: 'dict_type', type: 'varchar', length: 100, comment: '字典类型' })
  @ApiProperty({ description: '字典类型' })
  dictType: string

  @Column({ type: 'tinyint', default: 0, comment: '状态（0正常 1停用）' })
  @ApiProperty({ description: '状态（0正常 1停用）' })
  status: number

  @Column({ name: 'color_type', type: 'varchar', length: 100, default: '', comment: '颜色类型' })
  @ApiProperty({ description: '颜色类型' })
  colorType: string

  @Column({ name: 'css_class', type: 'varchar', length: 100, default: '', comment: 'css 样式' })
  @ApiProperty({ description: 'css 样式' })
  cssClass: string

  @Column({ type: 'varchar', length: 500, nullable: true, comment: '备注' })
  @ApiProperty({ description: '备注' })
  remark: string
}
